package com.ybkj.daijia.server.mapper;

import com.ybkj.daijia.server.model.OrderFinishedInfo;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface OrderFinishedInfoMapper {

    /**
     * 保存订单结算信息
     *
     * @param member
     * @return
     */
    int insertRecord(OrderFinishedInfo orderFinishedInfo);

    /**
     * 根据主键查询订单结算信息
     *
     * @param id
     * @return
     */
    OrderFinishedInfo selectByPrimaryKey(Long id);

    OrderFinishedInfo selectByOrder(Long orderId);


    /**
     * 根据一组主键查询订单结算信息
     *
     * @param ids
     * @return
     */
    List<OrderFinishedInfo> selectByIdIn(Long ids[]);

    /**
     * 根据主键删除订单结算信息
     *
     * @param id
     * @return 返回影响的行数
     */
    int deleteByPrimaryKey(Long id);

    void updateByPrimaryKey(OrderFinishedInfo orderFinishedInfo);

    BigDecimal sumRealCashByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumRealCashComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumRealCashGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumCouponMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumCouponMoneyComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumCouponMoneyGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumPayMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumPayMoneyComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumPayMoneyGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumCompanyMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumCompanyMoneyComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumCompanyMoneyGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumDriverMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumDriverMoneyComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumDriverMoneyGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumInfofeeByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumInfofeeComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumInfofeeGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumDjxfeeByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumDjxfeeComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumDjxfeeGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumYwxfeeByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumYwxfeeComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumYwxfeeGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumManagerMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumManagerMoneyComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumManagerMoneyGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumRebateMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumRebateMoneyComeInByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumRebateMoneyGetoutByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllRealCashByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllCouponMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllPayMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllCompanyMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllDriverMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllManagerMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllInfofeeByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    BigDecimal sumAllRebateMoneyByCompanyWithDate(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);

    List<OrderFinishedInfo> findBycompanyId(@Param("companyId") Long companyId,
        @Param("start") Date start, @Param("end") Date end);


}
